package com.example.demo.controller;

import com.example.demo.Service.PayBillTradeService;
import com.example.demo.beans.PayBillTradeRequest;
import com.example.demo.beans.PayBillTradeResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**执行缴费
 * Created by Administrator on 2018-05-08.
 */
@RestController
public class PayBillTradeController {
    @Autowired
    @Qualifier("PayBillTradeService")
    private  PayBillTradeService service;

    @ResponseBody
    @RequestMapping(value = "PayBillTrade",produces = "application/xml")
 public PayBillTradeResponse PayBillTrade(@RequestBody(required = false)PayBillTradeRequest request)
    { if(request!=null){
     return    service.PayBill(request);
    }
    else {PayBillTradeResponse response=new PayBillTradeResponse();
    response.setResultCode("1");
    response.setResultMsg("获取到的信息为NULL，请查证！");
     return  response;
    }
    }
}
